//
//  XFDNetAction.m
//  BlocksKit
//
//  Created by 韩冰 on 2017/11/13.
//

#import "XFDNetAction.h"
#import <XMNetworking/XMNetworking.h>
#import <IQKeyboardManager/IQKeyboardManager.h>
#import "HBMacros.h"
#import "XFDUserManage.h"

@implementation XFDNetAction

+ (instancetype)share{
    static dispatch_once_t onceToken;
    static XFDNetAction * api;
    dispatch_once(&onceToken, ^{
        api = [XFDNetAction new];
    });
    return api;
}

- (void)tokenIneffectiveness:(BackClickBlock)block{
    
    self.backClickBlock = ^{
        if (block) {
            block() ;
        }
    };
}
- (void)no_token{
    
    if (self.backClickBlock) {
        [XFDUserManage deleteToken];
        self.backClickBlock();
    }
}

- (void)invalidRole:(NSString *)tip{
    if(self.invalidRoleBlock){
        self.invalidRoleBlock(tip);
    }
}
- (void)invalidRoleOnThisApp:(InvalidRoleBlock)block{
    self.invalidRoleBlock = ^(NSString *tips){
        if (block) {
            block(tips) ;
        }
    };
}

@end
